package studentService

import (
	"goproject/src/dbutil"
	"goproject/src/studentMapper"
	"time"
)

func Save(student studentMapper.Student) {
	db := dbutil.GetDB()
	student.CreateTime = time.Now()
	studentMapper.Save(student, db)
}

func UpdateById(student studentMapper.Student) {
	db := dbutil.GetDB()
	studentMapper.UpdateById(student, db)
}

func GetById(id string) studentMapper.Student {
	db := dbutil.GetDB()
	return studentMapper.GetId(id, db)
}

func DeleteById(id string) {
	db := dbutil.GetDB()
	studentMapper.DeleteById(db, id)
}
